package com.fh.shop.api.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class RegUtil {
    //验证手机号是否正确
    public static boolean isPhone(String phone){
        return phone.matches("^[1][3,5,6,7,8][0-9]\\d{8}$");
    }
    //验证邮箱正则
    public static boolean isMail(String mail){
        return mail.matches("^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$");
    }
}
